package demo14;

public abstract class User { // 设置为抽象类，防止外部人员创建该类
    private String name; // 姓名
    private double money; // 余额

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getMoney() {
        return money;
    }

    public void setMoney(double money) {
        this.money = money;
    }

    public User() {
    }

    public User(String name) {
        this.name = name;
    }

    public User(String name, double money) {
        this.name = name;
        this.money = money;
    }

    public void showMoney() { // 展示当前用户信息
        System.out.println("用户名：" + name + "；余额：" + money + "￥");
    }
}
